<?php 
$data['page_selected'] = 'management';
$this->load->view('constants/header', $data);?>

<style>
	.formField .InputValue{
		color:#999;
		position: absolute;
		z-index: 1;
		left: 530px;
		font-style:italic;
	}
</style>

<div id="site_content">
	<?php $this->load->view('constants/sidebar'); ?> 
    <div id="content">
    	<?php $this->load->view('management/menu'); ?>
        <br /><br /><br /><br />
  		<form action="<?php echo base_url(); ?>management/new_institution" method="post">
            <h3 align="center">Nueva Instituci&oacute;n</h3>
            <h2 style="font-size:10px"><img src="<?php echo base_url().IMG; ?>icon_RequiredField.png">&nbsp; Campos Obligatorios</h2>
            <table>
                <tr>
                	<td> <img src="<?php echo base_url().IMG; ?>icon_RequiredField.png">&nbsp;Nombre </td>
                    <td> <input type="text" name="name" id="name" value="<?php echo set_value('name'); ?>"/> </td>
                    <td> <?php echo form_error('name'); ?> </td>
                </tr>
                <tr>
                	<td> <img src="<?php echo base_url().IMG; ?>icon_RequiredField.png">&nbsp;C&oacute;digo </td>
                    <td> <input type="text" name="code" id="code" value="<?php echo set_value('code'); ?>"/> </td>
                    <td> <?php echo form_error('code'); ?> </td>
                </tr>
                <tr>
                	<td> <img src="<?php echo base_url().IMG; ?>icon_RequiredField.png">&nbsp;Rif </td>
                    <td> <input type="text" name="rif" id="rif" value="<?php echo set_value('rif'); ?>"/> </td>
                    <td> <?php echo form_error('rif'); ?> </td>
                </tr>
                <tr>
                	<td> <img src="<?php echo base_url().IMG; ?>icon_RequiredField.png">&nbsp;Tipo de instituci&oacute;n </td>
                    <td> 
                    	<select name="institutionType" id="institutionType"> 
                        	<?php foreach($institutionTypes as $i){ ?>
                            	<option value="<?php echo $i['tipo_cod_inst_edu'] ?>" <?php echo set_select('institutionType', $i['tipo_cod_inst_edu']); ?>>
									<?php echo $i['descripcion']; ?>
                                </option>
                            <?php } ?>
                        </select>
                    </td>
                    <td> <?php echo form_error('institutionType'); ?> </td>
                </tr>
                <tr>
                	<td rowspan="7"> <img src="<?php echo base_url().IMG; ?>icon_RequiredField.png">&nbsp;Direcci&oacute;n </td>
                    <td> 
                    	<textarea name="address" id="address" cols="17" rows="6"><?php echo set_value('address'); ?></textarea>
                    </td>
                    <td>
                    	<?php echo form_error('address'); ?> 
                    </td>
                </tr>
                <tr>
                	<td>                        
                        <div class="formField" id="coS">
                        	<span class="InputValue" >
								<?php if (set_value('country') == "") {?> 
                                	Pa&iacute;s
                                <?php } ?>
                            </span>
                            <input type="text" name="country" id="country" onfocus="onFocusInput('co')" onblur="onBlurInput('country','co', 'Pa&iacute;s')" value="<?php echo set_value('country'); ?>" /> 
                        </div>
                    </td>
                    <td>
                    	<?php echo form_error('country'); ?>
                    </td>
                </tr>
                <tr>
                	<td>
                        <div class="formField" id="stS"> 
                        	<span class="InputValue" >
                            	<?php if (set_value('state') == "") {?> 
                                	Estado
                                <?php } ?>
                            </span>
                            <input type="text" name="state" id="state" onfocus="onFocusInput('st')" onblur="onBlurInput('state','st', 'Estado')" value="<?php echo set_value('state'); ?>"/> 
                        </div>
                   	</td>
                    <td>
                    	<?php echo form_error('state'); ?>
                    </td>
                </tr>
                <tr>
                	<td>
                        <div class="formField" id="muS">
                        	<span class="InputValue">
                            	<?php if (set_value('municipality') == "") {?> 
                                	Municipio
                                <?php } ?>
                            </span>
                            <input type="text" name="municipality" id="municipality" onfocus="onFocusInput('mu')" onblur="onBlurInput('municipality','mu', 'Municipio')" value="<?php echo set_value('municipality'); ?>"/>
                        </div>
                        </td>
                    <td>
                    	<?php echo form_error('municipality'); ?>
                    </td>
                </tr>
                <tr>
                	<td>
                        <div class="formField" id="paS"> 
                        	<span class="InputValue">
                            	<?php if (set_value('parish') == "") {?> 
                                	Parroquia
                                <?php } ?>
                            </span>
                            <input type="text" name="parish" id="parish" onfocus="onFocusInput('pa')" onblur="onBlurInput('parish','pa', 'Parroquia')" value="<?php echo set_value('parish'); ?>"/>
                        </div>
                        </td>
                    <td>
                    	<?php echo form_error('parish'); ?>
                    </td>
                </tr>
                <tr>
                	<td>
                        <div class="formField" id="avS"> 
                        	<span class="InputValue">
                            	<?php if (set_value('avenue') == "") {?> 
                                	Avenida
                                <?php } ?>
                            </span>
                            <input type="text" name="avenue" id="avenue" onfocus="onFocusInput('av')" onblur="onBlurInput('avenue','av', 'Avenida')" value="<?php echo set_value('avenue'); ?>"/>
                        </div>
                        </td>
                    <td>
                    	<?php echo form_error('avenue'); ?>
                    </td>
                </tr>
                <tr>
                	<td>
                        <div class="formField" id="strS"> 
                        	<span class="InputValue">
                            	<?php if (set_value('street') == "") {?> 
                                	Calle
                                <?php } ?>
                            </span>
                            <input type="text" name="street" id="street" onfocus="onFocusInput('str')" onblur="onBlurInput('street','str', 'Calle')" value="<?php echo set_value('street'); ?>"/>
                        </div>
                        </td>
                    <td>
                    	<?php echo form_error('street'); ?>
                    </td>
                </tr>
                <tr>
                	<td> Punto de referencia </td>
                    <td> <input type="text" name="referencePoint" id="referencePoint" /> </td>
                    <td></td>
                </tr>
                <tr>
                	<td> <img src="<?php echo base_url().IMG; ?>icon_RequiredField.png">&nbsp;Tel&eacute;fono </td>
                    <td> <input type="text" name="phone" id="phone" value="<?php echo set_value('phone'); ?>"/> </td>
                    <td> <?php echo form_error('phone'); ?> </td>
                </tr>
                <tr>
                	<td> Fax </td>
                    <td> <input type="text" name="fax" id="fax" /> </td>
                    <td></td>
                </tr>
                <tr>
                	<td> <img src="<?php echo base_url().IMG; ?>icon_RequiredField.png">&nbsp;Correo electr&oacute;nico </td>
                    <td> <input type="text" name="email" id="email" value="<?php echo set_value('email'); ?>"/> </td>
                    <td> <?php echo form_error('email'); ?> </td>
                </tr>
                <tr>
                	<td> Seud&oacute;nimo de Twitter </td>
                    <td> <input type="text" name="twitter" id="twitter" value="<?php echo set_value('twitter'); ?>"/> </td>
                    <td> <?php echo form_error('twitter'); ?> </td>
                </tr>
                <tr>
                	<td> Facebook </td>
                    <td> <input type="text" name="facebook" id="facebook" value="<?php echo set_value('facebook'); ?>"/> </td>
                    <td> <?php echo form_error('facebook'); ?> </td>
                </tr>
                <tr>
                	<td> P&aacute;gina Web </td>
                    <td> <input type="text" name="webpage" id="webpage" value="<?php echo set_value('webpage'); ?>"/> </td>
                    <td> <?php echo form_error('webpage'); ?> </td>
                </tr>
                <tr>
                	<td> <img src="<?php echo base_url().IMG; ?>icon_RequiredField.png">&nbsp;Nombre de persona contacto </td>
                    <td> <input type="text" name="contactName" id="contactName" value="<?php echo set_value('contactName'); ?>"/> </td>
                    <td> <?php echo form_error('contactName'); ?> </td>
                </tr>
                <tr>
                	<td> <img src="<?php echo base_url().IMG; ?>icon_RequiredField.png">&nbsp;Tel&eacute;fono de persona contacto </td>
                    <td> <input type="text" name="contactPhone" id="contactPhone" value="<?php echo set_value('contactPhone'); ?>"/> </td>
                    <td> <?php echo form_error('contactPhone'); ?> </td>
                </tr>
                <tr>
                	<td> <img src="<?php echo base_url().IMG; ?>icon_RequiredField.png">&nbsp;Correo electr&oacute;nico de persona contacto </td>
                    <td> <input type="text" name="contactEmail" id="contactEmail" value="<?php echo set_value('contactEmail'); ?>"/> </td>
                    <td> <?php echo form_error('contactEmail'); ?> </td>
                </tr>
      		</table>
            <p><input type="submit" name="button" class="submit" value="Cargar reporte" /></p>
        </form>
    </div>
</div>
<script type="text/javascript">	
	function onFocusInput(divId){
		$('#'+divId+'S span').html("");
	}
	
	function onBlurInput(inputId, divId, value){
		if($('#'+inputId+'').val() == "")
			$('#'+divId+'S span').html(value);
		else
			$('#'+divId+'S span').html("");
	}
</script>
<?php $this->load->view('constants/footer'); ?>